package Day009_Map_斗地主_冒泡排序.ZuoYe;

import java.util.ArrayList;
import java.util.HashSet;

public class Test4 {
    public static void main(String[] args) {

        ArrayList<String> list = new ArrayList<>();
        list.add("a");
        list.add("f");
        list.add("b");
        list.add("c");
        list.add("a");
        list.add("d");
        System.out.println(list); //[a, f, b, c, a, d]

        HashSet<String> set = new HashSet<>();
        for (int i = 0; i < list.size(); i++) {
            String s = list.get(i);
            set.add(s);
        }
        System.out.println(set); //[a, b, c, d, f]
    }
}
